package org.shoukaiseki.supersaiyan.db.inittable.system;


import org.shoukaiseki.inittable.domain.TableColumnInfo;
import org.shoukaiseki.inittable.domain.TableIndexInfo;
import org.shoukaiseki.inittable.service.ITableBuildInfoService;
import org.shoukaiseki.kakaroto.SksDictUtils;
import org.shoukaiseki.kakaroto.annotation.TableBuild;
import org.shoukaiseki.supersaiyan.enums.Sks0Enable1Deactivate;

import java.util.List;

import static org.shoukaiseki.inittable.utils.SksColumnCamelCaseCommon.*;
import static org.shoukaiseki.inittable.utils.TableColumnInfoBuilder.column;
import static org.shoukaiseki.inittable.utils.TableInfoUtils.tableColumns;

@TableBuild(name = "sys_site", comment = "站点",version = 1)
public class SysSiteInitTableInfo implements ITableBuildInfoService {


    @Override
    public List<TableColumnInfo> tableColumnInfoList(){
        List<TableColumnInfo> table = tableColumns(
                uniqueId("site_id"),
                varColumn("site_name","站点"),

                column(" lon            double(9, 6)      null comment '经度',"),
                column(" lat            double(8, 6)      null comment '纬度',"),
                column(" geo_code       char(12)            default ''                not null comment 'geohash编码',"),
                varColumn("meal_dept_phone","膳食科电话"),

                intColumnUnsigned("usable_pay_mode","可用的支付方式",0x7ffe)
                        .description("按位方式开启,0xffff为全部开启"),
                        //详见 CustOrderPayMode.class 枚举类,

                column("    remark                 varchar(500)    default ''                not null comment '备注',"),

                column("    content                text                     null comment '说明',"),
                column("    notepad                varchar(128)    default ''                not null comment '注释',"),
                column("    description            varchar(128)    default ''                not null comment '描述',"),


                status()
                        .description(SksDictUtils.getDictInfo(Sks0Enable1Deactivate.class)),

                orgId(),
                createUserId(),
                createTime(),
                updateUserId(),
                updateTime(),
                delFlag(),
                rowstamp(),
                null
        );

        return table;
    }

}
